﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Main
{
    public partial class _Default : System.Web.UI.Page
    {
        private String RegisterURL_str = "~/Account/Register.aspx";

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CreateNewProject_Btn_Click(object sender, EventArgs e)
        {
            String navigateTo_str = "";
            bool isLoggedOn = true;//TODO is login
            if (isLoggedOn)
            {
                navigateTo_str = "CreateNewProject.aspx";
            }
            else
            {
                navigateTo_str = RegisterURL_str;
            }
            Response.Redirect(navigateTo_str);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void StartRegister_Btn_Click(object sender, EventArgs e)
        {
            Button selectedButton = (Button)sender;
            String url = RegisterURL_str;

            url += "?type=0";
            if (selectedButton == StartDeveloper_Btn)
            {
                url += "0";
            }
            else if (selectedButton == StartDesigner_Btn)
            {
                url += "1";
            }
            else if (selectedButton == StartVendor_Btn)
            {
                url += "2";
            }

            Response.Redirect(url);
        }
    }
}
